﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TekaMUD.Engine.Blocks
{
	/// <summary>
	/// A logical grouping of Rooms.
	/// </summary>
	[Serializable]
	public class Sector : GameEntity
	{
		private int _roomCounter;

		public EnumRoomFlags Flags { get; set; }
		public string Name { get; set; }

		
		[Obsolete("conside abolishing this.")]
		public Room StartRoom { get; set; }
		public Continent Continent { get; set; }

		public Sector()
		{
			_roomCounter = 0;
		}

		public void AddRoom(Room r)
		{
			int i;

			lock (this.SyncRoot)
			{
				i = _roomCounter++;
				r.SectorRoomID = i;
				r.Sector = this;
			}
		}

		public override string ToString()
		{
			return "Sector " + Name + ". " + _roomCounter + " rooms.";
		}
	}
}
